<?php
require_once 'DB.php';
$db = DB::connect($dsn);
if (DB::isError($db)) {
	die ($db->getMessage());
}

  if(!$_GET['adminMenu']){
  $adminMenu = '0';
  }else{
  $adminMenu = $_GET['adminMenu'];
  }

//Figure out crumbtrail
if($adminMenu == '0'){
	$crumb = "Print Options";
}

    echo"<table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td style=\"width:25px; background-image:url(images/subHeaderGradient.gif);background-position:left top;background-repeat: repeat-y;\" ></td>
    <td style=\"background-image:url(images/sysAdmin.gif);background-position:left center;background-repeat: no-repeat;\"  class=\"subHeader\"><U>$pageTitle</U> :: $crumb</td>
    <td style=\"background-color:#000000; width:30px; background-image:url(images/subHeaderCorner.gif); background-position:right top;background-repeat:no-repeat;\">&nbsp;</td>
  </tr></TABLE>";//end Title Row

  $tabWidths = array();
  $tabWidths[0]['left'] = '0';
  $tabWidths[0]['text'] = 'Print Options';




  //ADMIN NAVIGATION
echo"<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
	<TR>
		<TD valign=\"bottom\"><ul id=\"admintopnav\">";

		for ($i = 0; $i < count($tabWidths); $i++) {
			if($adminMenu == $i){
				echo "<li ><DIV style=\"left:" .$tabWidths[$i]['left'].";\" class=\"here\">" .$tabWidths[$i]['text']. "</DIV></li>";
			}else{
				echo"<li ><a id=\"a$i\" href=\"index.php?ID=5&adminMenu=$i\" >" .$tabWidths[$i]['text']. "</a></li>";
			}
		}

			echo"</ul>
		</TD>
	</TR>
	<TR><TD><DIV class=\"adminsubnav3\"></DIV></TD></TR>
	</TABLE>";
 //END ADMIN NAVIGATION

 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 //BEGIN section for updating print Weekly Planner options
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  if($adminMenu == '0'){
  echo"<!--BEGIN Row for Dsiplaying Print options for grid-->
  <table width=\"100%\"  border=\"0\" cellpadding=\"4\"><TR><TD>
  <table border=\"1\" width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\"><TR><TD>

  	<table border=\"0\" width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\">
	    <form action=\"formaction.php\" method=\"post\" enctype=\"multipart/form-data\" name=\"PrintOptions\">

		<TR>
			<TD bgcolor=\"$colorTheme\" class=\"adminSectionHeader\" style=\"color:$highLightFont;\">
			Weekly Planner Print Options:
			</TD>
		</TR>

		<TR>
			<TD bgcolor=\"$colorTheme\" class=\"adminSectionDescription\">
			Check the fields you want to include in the Weekly Planner print out.
			</TD>
		</TR>

		<TR>
			<TD>
							<table border=\"1\" width=\"100%\"  cellpadding=\"0\" cellspacing=\"0\">
				<TR class=\"adminSectionContent\">
					<TD>";




						$sql = "SELECT * FROM user_options WHERE station = '$stationID'";
						$result = $db->getAll($sql, DB_FETCHMODE_ASSOC);
						 if (DB::isError($result)) {
						 die ($result->getMessage());
						 }


						if($result[0]["planner_print_client"] == 'true'){
							echo "Client Name<BR><input name=\"client\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Client Name<BR><input name=\"client\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD><TD>";

						if($result[0]["planner_print_spot"] == 'true'){
							echo "Spot Name<BR><input name=\"spot\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Spot Name<BR><input name=\"spot\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD><TD>";


						if($result[0]["planner_print_trade"] == 'true'){
							echo "Trade<BR><input name=\"trade\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Trade<BR><input name=\"trade\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD><TD>";


						if($result[0]["planner_print_rate"] == 'true'){
							echo "Rate<BR><input name=\"rate\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Rate<BR><input name=\"rate\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD><TD>";


						if($result[0]["planner_print_live"] == 'true'){
							echo "Live Read<BR><input name=\"live\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Live Read<BR><input name=\"live\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD><TD>";


						if($result[0]["planner_print_type"] == 'true'){
							echo "Type (UW/PSA)<BR><input name=\"type\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Type (UW/PSA)<BR><input name=\"type\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD><TD>";


						if($result[0]["planner_print_length"] == 'true'){
							echo "Spot Length<BR><input name=\"length\" type=\"checkbox\" value=\"true\" checked>";
						}else{
							echo "Spot Length<BR><input name=\"length\" type=\"checkbox\" value=\"true\">";
						}

					echo"</TD>
				</TR>
	</TABLE>
  			</TD>
		</TR>

		<!--SUBMIT BUTTON-->
  		<TR>
			<TD bgcolor=\"#CCCCCC\" align=\"center\" style=\"padding-top:5px; padding-bottom:5px; \">
			<input name=\"action\" type=\"hidden\" value=\"plannerPrintOptions\"><input name=\"submit\" type=\"submit\" class=\"inputButton\"  value=\"Submit\"> &nbsp; &nbsp; &nbsp; <input name=\"reset\" type=\"reset\" class=\"inputButton\" value=\"Reset\">
			</TD>
		</TR>
		<!--END SUBMIT BUTTON-->
		  </FORM>

  </TABLE>
  </TD></TR></TABLE>
  </TD></TR></TABLE>
  <!--END Row for Dsiplaying Print options for grid-->";
}
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 //END section for updating print Weekly Planner options
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++

?>